package com.graduationdesign.zengyan.graduationdesignapp;

import android.app.Application;
import android.arch.persistence.room.Room;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.dataBase.AppDatabase;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;


/**
 * Created by ZengYan on 2018/4/15.
 *
 * @desc :
 */
public class BaseApplication extends Application{

    public static  Application Instance ;

    public static AppDatabase mDatabase = null;



    @Override
    public void onCreate() {
        super.onCreate();
        Logger.addLogAdapter(new AndroidLogAdapter());
        this.Instance = this;
        Fresco.initialize(this);
        mDatabase =  Room.databaseBuilder(BaseApplication.Instance,
                AppDatabase.class, "database-name").build();

    }
}